<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="icon" href="__ROOT__/favicon.ico">

    <title>{$Think.config.CMS_COMPANY}</title>

    <link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css">
    <!--[if IE 7]>
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome-ie7.min.css">
    <![endif]-->
    <link rel="stylesheet" href="__PUBLIC__/icheck/css/blue.css">
    <link rel="stylesheet" href="__PUBLIC__/validform/css/validform.css">
    <link href="__PUBLIC__/zebra-dialog/css/zebra.dialog.css" rel="stylesheet">
    <link href="__PUBLIC__/uploadify/uploadify.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/custom/css/admin-theme-default.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="__PUBLIC__/bootstrap/js/jquery.min.js"></script>
    <script src="__PUBLIC__/bootstrap/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/uploadify/jquery.uploadify.min.js"></script>
    <script src="__PUBLIC__/umeditor/ueditor.config.js"></script>
    <script src="__PUBLIC__/umeditor/ueditor.all.js"></script>
  </head>
<?php
  $thisModel = $Think.MODULE_NAME; 
  $parentMenus = R('Common/Adminbase/getParentMenu'); /*获得 顶部菜单*/
?>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#"><i class="icon-coffee"></i> {$Think.config.CMS_COMPANY} </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-left">
            <foreach name="parentMenus" item="parentMenu">
            <li <if condition="strnatcasecmp($parentMenu['model'],$thisModel)==0">  class="active"</if> ><a href="__ROOT__/{$parentMenu.model|strtolower}/{$parentMenu.controller|strtolower}/{$parentMenu.action|strtolower}"><i class="{$parentMenu.icon}"></i> {$parentMenu.name}</a></li>
            </foreach>
            <li class="nav-bar-icon">
              <a href="/" target="_blanck" class="btn btn-danger  btn-xs"><i class="icon-home"></i></a>
              <a href="{:U('content/cache/index')}" class="btn btn-warning btn-xs"><i class="icon-refresh"></i></a>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user-md"></i> {$_SESSION['ADMIN_NAME']}<b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="{:U('account/user/index')}"><i class="icon-wrench"></i>&nbsp;&nbsp; 帐户设置</a></li>
                <li class="divider"></li>
                <li><a href="{:U('admin/index/loginOut')}"><i class="icon-off"></i>&nbsp;&nbsp; 退出</a></li>
              </ul>
            </li>
          </ul>
        </div>
      </div>
    </nav>
<?php 
  $thisController = $Think.CONTROLLER_NAME;
  $thisAction = $Think.ACTION_NAME;

  $childrenMenus = R('Common/Adminbase/getChildrenMenu',array($thisModel,'1')); /*获得 顶部菜单*/

?>

  <div class="container-fluid">
      <div class="row">
        <div class="col-sm-2 col-md-2 sidebar">
          <ul class="nav nav-first-sidebar">
            <volist name="childrenMenus.firstMenu" id="firstMenu" key="k">
              <li <if condition="strnatcasecmp($firstMenu['controller'],$thisController) == 0">class="active"</if> ><a href="__ROOT__/{$firstMenu.model|strtolower}/{$firstMenu.controller|strtolower}/{$firstMenu.action|strtolower}"><i class="{$firstMenu.icon}"></i> {$firstMenu.name}</a>
                <notempty name="firstMenu.seccondMenu">
                 <ul class="nav nav-seccond-sidebar">
                  <volist name="firstMenu.seccondMenu" id ="seccondMenu">
                  <li <if condition="strnatcasecmp($seccondMenu['action'],$thisAction) ==0  and strnatcasecmp($seccondMenu['controller'],$thisController) == 0">class="active"</if>> <a href="__ROOT__-{$seccondMenu.model|strtolower}/{$seccondMenu.controller|strtolower}/{$seccondMenu.action|strtolower}"><i class="{$seccondMenu.icon}"></i> {$seccondMenu.name}</a></li>
                  </volist>

                </ul>
                </notempty> 
              </li>
            </volist> 
          </ul> 
        </div>

           
